package lab02.test29;

public class Test29 {
    public static void main(String[] args) {
        int[] number = new int[5];
        number[0] = 12;
        number[1] = 16;
        number[2] = 14;
        number[3] = 19;
        number[4] = 20;

        System.out.println(number[0]);
        System.out.println(number[1]);

        try {
            //有可能出错代码
            System.out.println(number[5]);

        }
        catch (ArrayIndexOutOfBoundsException e) {

            //出的什么错误
            //出错了如何处理
            System.out.println("数组越界" );

        }
        finally {
            //不管如何都会执行的代码
            System.out.println("最终执行的代码,不管怎么样");

        }
    }
}
